package com.gxa.controller.statistics;

import com.gxa.common.R;
import com.gxa.entity.DistrictSysInfoStatistics;
import com.gxa.service.InfoRegStatisticsService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;


import java.util.Date;


@Controller
@Api(value = "信息登记统计表",tags ="信息登记统计表接口API")
@RequestMapping("/infoRegStatistics")
public class InfoRegStatisticsController {

    @Autowired
    private InfoRegStatisticsService infoRegStatisticsService;

    /**
     * 分页查询信息登记表
     * @param currentPage
     * @return
     */
    @RequestMapping(value = "/findinfostatistics",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "查询信息登记统计表接口",notes = "查询信息登记统计表",httpMethod = "POST", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页",required = true,dataType = "int",paramType = "query"),
            @ApiImplicitParam(name = "currentDate",value = "当前时间",paramType = "query",dataType = "int",required = true)
    })
    @ApiResponses({
            @ApiResponse(code=200,message="查询成功"),
            @ApiResponse(code=401,message="token为空"),
            @ApiResponse(code=1005,message="Token过期"),
            @ApiResponse(code=1006,message="Token验证不通过"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    public R findinfostatistics(Integer currentPage){
        return infoRegStatisticsService.findinfostatistics(currentPage);
    }


    /**
     * 根据日期查询信息登记统计表
     * @param currentPage
     * @param currentDate
     * @return
     */
    @RequestMapping(value = "/findinfostatisticsbydate",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "根据日期查询信息登记统计表接口",notes = "根据日期查询信息登记统计表",httpMethod = "POST", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页",required = true,dataType = "int",paramType = "query"),
            @ApiImplicitParam(name = "chooseDate",value = "选择时间",paramType = "query",dataType = "int",required = true)
    })
    @ApiResponses({
            @ApiResponse(code=200,message="查询成功"),
            @ApiResponse(code=401,message="token为空"),
            @ApiResponse(code=1005,message="Token过期"),
            @ApiResponse(code=1006,message="Token验证不通过"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    public R findinfostatisticsbydate(Integer currentPage, @DateTimeFormat(pattern = "yyyy-MM-dd") Date currentDate){
        return infoRegStatisticsService.findinfostatisticsbydate(currentPage,currentDate);
    }
}
